Compile bundled files and typing files#671
Merged
johnnyreilly merged 3 commits intoTypeStrong:masterfrom Oct 26, 2017
Merged
Conversation
Member
|
Awesome - thanks for this! I'll try and take a look later on. BTW we only need comparison test output for the latest released version of TypeScript (2.5 right now). I really should make that clearer in the docs! |
src/index.ts
Outdated
|
|
||
| type ValidLoaderOptions = keyof LoaderOptions; | ||
| const validLoaderOptions: ValidLoaderOptions[] = ['silent', 'logLevel', 'logInfoToStdOut', 'instance', 'compiler', 'configFile', 'transpileOnly', 'ignoreDiagnostics', 'errorFormatter', 'colors', 'compilerOptions', 'appendTsSuffixTo', 'appendTsxSuffixTo', 'entryFileCannotBeJs' /* DEPRECATED */, 'happyPackMode', 'getCustomTransformers']; | ||
| const validLoaderOptions: ValidLoaderOptions[] = ['silent', 'logLevel', 'logInfoToStdOut', 'instance', 'compiler', 'configFile', 'transpileOnly', 'ignoreDiagnostics', 'errorFormatter', 'colors', 'compilerOptions', 'appendTsSuffixTo', 'appendTsxSuffixTo', 'entryFileCannotBeJs', 'onlyCompileBundledFiles' /* DEPRECATED */, 'happyPackMode', 'getCustomTransformers']; |
Member
There was a problem hiding this comment.
Please can you move /* DEPRECATED */ back to after 'entryFileCannotBeJs?
Member
|
Generally this looks good - could you remove comparison test output apart from 2.5? Also could you add something to the |
Remove unnecessary expected output for tests Add documentation on the option to the README Fix location of a comment in src/index.ts
Contributor
Author
|
@johnnyreilly Thanks for the quick review. I made some updates to address your comments. |
Member
|
Sweet - I'll try and take a look tomorrow. Thanks! |
Member
|
Perfect! |
Member
|
Hope to ship this with ts-loader 3.1.0 |
qazbnm456
added a commit
to LulumiProject/lulumi-browser
that referenced
this pull request
Oct 31, 2017
qazbnm456
added a commit
to LulumiProject/lulumi-browser
that referenced
this pull request
Oct 31, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a flag that modifies the behavior of
ts-loaderso that it only loads files that are bundled by webpack and any.d.tsfiles that match the config intsconfig.json. This is an attempt to implement the behavior described in #267, or at least a starting point.The approach is very simple and I can't help but feel like there's some obvious issue with it that I'm not thinking of, but it seems to work fine in the test case I created at least. The reason for compiling all
.d.tsfiles as well as bundled files is that they may include types that are used in files that are bundled without being explicitly imported. Attempting to determine exactly which files are needed seems like it may be quite difficult and potentially slow.